package edu.zut.software.identity.Repository;

import edu.zut.software.identity.domain.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Repository
public interface StudentRepository extends JpaRepository<Student,Object>, JpaSpecificationExecutor<Student> {
@Query(value = "select s.time as genre,COUNT(s.time) as sold\n" +
        "from zut.student s\n" +
        "group by s.time\n",nativeQuery = true)
    List<Map<Date, Integer>>getCount();
}
